package com.zkthink.ceres.product.service.impl;

import com.zkthink.ceres.product.dao.ShippingCompanyMapper;
import com.zkthink.ceres.product.dto.IdQueryDTO;
import com.zkthink.ceres.product.entity.ShippingCompany;
import com.zkthink.ceres.product.service.ShippingCompanyService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 善泉
 */
@Slf4j
@AllArgsConstructor
@Service
public class ShippingCompanyServiceImpl implements ShippingCompanyService {

	private ShippingCompanyMapper shippingCompanyMapper;

	@Override
	public List<ShippingCompany> findShippingCompanyList(String shippingCompanyName) {
		return shippingCompanyMapper.findShippingCompanyList(shippingCompanyName);
	}

	@Override
	public Boolean addShippingCompany(ShippingCompany shippingCompany){
		shippingCompanyMapper.insert(shippingCompany);
		return true;
	}

	@Override
	public Boolean updateShippingCompany(ShippingCompany shippingCompany) {
		shippingCompanyMapper.update(shippingCompany);
		return true;
	}

	@Override
	public Boolean deleteShippingCompany(IdQueryDTO idQueryDTO) {
		shippingCompanyMapper.deleteById(idQueryDTO.getId());
		return true;
	}


}
